1. Field of the Invention
The present invention pertains to a compiler and a method of compiling for generating object code described by a machine language from a source program described by a programming language, and a program development tool having the complier. In particular, the present invention pertains to a technology for building the function defined expansion specifications by a user into the compiler.
2. Description of the Related Art
In general, since a compiler for generating object code described by a machine language from a source program had varied depending on processor architecture, and the processing procedure of intrinsic function had been also built into the compiler, it was impossible for a user to modify the intrinsic function individually. Therefore, in order to execute an application program etc. on the processor expandable (configurable) user specifications such as the processor architecture and an instruction set, a compiler corresponding to the user expansion specifications had been needed.
For this reason, the present applicant proposed a compiler in which the user can customize the intrinsic function according to the user expansion specifications, in Japanese Patent Laid Open Publication (Kokai) No. 2002-24029.
According to the compiler disclosed in above publication, however, even if instruction statements for executing a processing operation equivalent to a processing operation by using the intrinsic function defined by the user are described by the programming language in the source program, it was impossible to convert the instruction statements to the machine language according to the user-defined intrinsic function defined by the user (user-defined intrinsic function).
For example, when an intrinsic function “uci” (F91) for executing processing operations to add “10” to a source register and store the value masked by “_imm” in a destination register is declared into a source program as shown in FIG. 1A, the compiler can convert from an instruction statement T91 calling explicitly the intrinsic function “uci” in the source program to a machine language (machine language M91 shown in FIG. 1B) by using the instruction “uci” according to the user-definition.
However, even if an instruction statement T92 for executing processing operations equivalent to the processing operations (processing operation to add “10” to the source register and store the value masked by “_imm” in the destination register) which the instruction statement T91 executes by using the intrinsic function “uci”, is described in the source program, the compiler cannot convert the instruction statement T92 to the machine language by using the instruction “uci” defined by the user. As a result, the compiler generates conventional machine language (machine language M92 in FIG. 1B) by using the conventional instruction “add”. In order to generate the machine language by using instruction “uci” defined by the user from the instruction statement T92, the user needs to rewrite the description of the instruction statement T92 to the instruction statement T91 which explicitly calls the intrinsic function “uci”.
Thus, the user had needed to have full knowledge about the user-defined intrinsic function during the describing of the source program. The user further had needed to rewrite the applicable portion of the operations among the description of the source program to the user-defined instruction function, when the specifications of the processor were extended. Therefore, it was the problem that enormous amounts of time and cost were required in the design of the processor and/or its application programs.